/**
 * Created by Administrator on 2015/11/18.
 */
var mysql      = require('mysql');
//console.log(typeof mysql);
//var connection = mysql.createConnection({
//    host     : 'localhost',
//    user     : 'root',
//    password : '',
//    database : 'hibernate1'
//});
//
//connection.connect();
//
//connection.query('SELECT 1 + 1 AS solution', function(err, rows, fields) {
//    if (err) throw err;
//
//    console.log('The solution is: ', rows[0].solution);
//});
//
//connection.end();
var ids = [5,6];
//var sql = mysql.format('delete from user where id in (??)',ids);
var param = '';
for(var i in ids){
    param = param + ','+ ids[i];
}
param.substr(param.indexOf(',')+1);
console.log(param);
console.log(param.indexOf(','));
var param1 = ',,,abc';
console.log(param1.replace(/(^,*)/g,''));
